create table if not exists jms_dm.dm_tab_transfer_mail_waybill_detail_dt
(
    del_falg           bigint comment '1打标0未达标 关联上说明打标,关联不上的未打标,',
    scan_site_code     varchar(50) comment '扫描站点code',
    agent_code         varchar(50) comment '代理区code',
    scan_time          varchar(100) comment '扫描时间',
    bill_code          varchar(100) comment ' 运单',
    input_site         varchar(100) comment '录入部门',
    agent_name         varchar(100) comment '代理区名称',
    scan_user_code     varchar(100) comment '扫描员',
    scan_user          varchar(100) comment '扫描员名称',
    arr_scan_time      varchar(100) comment '邮政到件时间',
    sig_scan_time      varchar(100) comment '邮政签收时间',
    sig_scan_site_code varchar(100) comment '签收网点',
    scan_site          varchar(100) comment '签收网点',
    arr_falg           bigint comment '1邮政到件0未邮政到件 关联上说明邮政/菜鸟,关联不上的未非邮政的',
    sig_falg           bigint comment '1签收0未签收 关联上说明签收,关联不上的未签收',
    cnyz_sig_falg      bigint comment '1邮政签收0未邮政签收 关联上说明邮政/菜鸟,关联不上的未非邮政的',
    date_time          date comment '日期',
    remark1            varchar(100) comment '备用',
    remark2            varchar(100) comment '备用'
) ENGINE = OLAP DUPLICATE KEY(del_falg, scan_site_code, agent_code,scan_time)
COMMENT "转邮监控明细"
PARTITION BY RANGE(date_time)
(START ("2022-07-01") END ("2022-08-15") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(bill_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-370",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);

